<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
 
    <ui:composition> 

        <p:dialog id="AlertsCreateDlg" widgetVar="AlertsCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{MyBundle.CreateAlertsTitle}" closeOnEscape="true">

            <h:form id="AlertsCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_type}" for="type" />
                        <p:inputText id="type" value="#{alertsController.selected.type}" title="#{MyBundle.CreateAlertsTitle_type}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_type}" size="20" maxlength="20"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_latitude}" for="latitude" />
                        <p:inputText id="latitude" value="#{alertsController.selected.latitude}" title="#{MyBundle.CreateAlertsTitle_latitude}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_latitude}"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_longitude}" for="longitude" />
                        <p:inputText id="longitude" value="#{alertsController.selected.longitude}" title="#{MyBundle.CreateAlertsTitle_longitude}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_longitude}"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_description}" for="description" />
                        <p:inputText id="description" value="#{alertsController.selected.description}" title="#{MyBundle.CreateAlertsTitle_description}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_description}" size="255" maxlength="255"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_phone}" for="phone" />
                        <p:inputText id="phone" value="#{alertsController.selected.phone}" title="#{MyBundle.CreateAlertsTitle_phone}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_phone}"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_name}" for="name" />
                        <p:inputText id="name" value="#{alertsController.selected.name}" title="#{MyBundle.CreateAlertsTitle_name}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_name}" size="25" maxlength="25"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_date}" for="date" />
                        <p:calendar id="date" pattern="MM/dd/yyyy HH:mm:ss" value="#{alertsController.selected.date}" title="#{MyBundle.CreateAlertsTitle_date}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_date}" showOn="button"/>

                        <p:outputLabel value="#{MyBundle.CreateAlertsLabel_user}" for="user" />
                        <p:selectOneMenu id="user" value="#{alertsController.selected.user}" required="true" requiredMessage="#{MyBundle.CreateAlertsRequiredMessage_user}" converter="usersConverter">
                            <f:selectItem itemLabel="#{MyBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{usersController.items}"
                                           var="userItem"
                                           itemValue="#{userItem}"
                                           itemLabel="#{userItem.user.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{alertsController.saveNew}" value="#{MyBundle.Save}" update="display,:AlertsListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,AlertsCreateDialog);">
                        <p:confirm header="#{MyBundle.ConfirmationHeader}" message="#{MyBundle.ConfirmCreateMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>

                    <p:commandButton value="#{MyBundle.Cancel}" onclick="AlertsCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
